<script>
import {ref, inject, h} from "vue";
import studentCommunal from "@/components/communal/student-communal.vue";
import footerCommunal from "@/components/communal/footer-communal.vue";
import {RouterLink} from "vue-router";
import {BookOutline as BookIcon} from "@vicons/ionicons5";
import {NIcon} from "naive-ui";
export default {
  name: "info-communal",
  components:{studentCommunal,footerCommunal},
  props:{
    actionKey:{
      type:String
    },
    core: {
      type: Boolean,
      default: true
    }
  },
  setup(){
    function renderIcon(icon) {
      return () => h(NIcon, null, { default: () => h(icon) });
    }
    const menuOptions = [
      {
        label: () => h(
            RouterLink,
            {
              to: {
                name: "home",
              }
            },
            { default: () => "首页" }
        ),
        key: "user-home",
        icon: renderIcon(BookIcon)
      },
      {
        label: () => h(
            RouterLink,
            {
              to: {
                name: "std/note",
              }
            },
            { default: () => "笔记" }
        ),
        key: "user-nav",
        icon: renderIcon(BookIcon)
      },
      {
        label: () => h(
            RouterLink,
            {
              to: {
                name: "std/learn",
              }
            },
            { default: () => "学习" }
        ),
        key: "user-learn",
        icon: renderIcon(BookIcon)
      },
    ]
    return{
      menu: ref(menuOptions)
    }
  }
}
</script>

<template>
  <student-communal :option="menu" action="info" :nav-key="actionKey">
    <slot/>
  </student-communal>

</template>

<style scoped>

</style>
